<a class="single_image" href="#image-<{$album_images.id}>" title="<{$album_images.title}>" rel="lightbox" id="imglink-<{$album_images.id}>" 
	 <{$album_image_margins}> maxheight="<{$album_images.max_height}>px" maxwidth="<{$album_images.max_width}>px" innerwidth="<{$album_images.display_width}>" innerheight="<{$album_images.display_height}>" >
	<img src="<{$album_images.thumb}>" alt"<{$album_images.title}>" />
</a>

<div style="display: none">
	<div class="img_content" id="image-<{$album_images.id}>">
		<title><{$album_images.title}></title>
		<img src="<{$album_images.img}>" alt"<{$album_images.title}>" />
		<div class="img_info">
			<{$smarty.const._MD_ALBUM_PUBLISHED_BY}>&nbsp;:&nbsp;<{$album_images.publisher}>&nbsp;
			(<a href="<{$album_url}>index.php?op=getByPublisher&uid=<{$album_images.img_publisher}>" title="<{$smarty.const._MD_ALBUM_GET_BY_PUBLISHER}>&nbsp;<{$album_images.uname}>">
				<{$smarty.const._MD_ALBUM_GET_BY_PUBLISHER}>&nbsp;<{$album_images.uname}>
			</a>)<br />
				
			<{if $album_images.updated_on}>
				<{$smarty.const._MD_ALBUM_UPDATED_ON}>&nbsp;:&nbsp;<{$album_images.updated_on}>
			<{else}>
				<{$smarty.const._MD_ALBUM_PUBLISHED_ON}>&nbsp;:&nbsp;<{$album_images.published_on}>
			<{/if}>
			<{if $album_images.userCanEditAndDelete}>
				&nbsp;|&nbsp;<{$album_images.editItemLink}><{$album_images.deleteItemLink}>
			<{/if}>
			<{if $album_images.urllink}>
				<br /><{$album_images.urllink}>
			<{/if}>
		</div>
		
		<{if $album_images.tags}>
			(&nbsp;<{$smarty.const._MD_ALBUM_TAGS}>&nbsp;:&nbsp;
				<div class="album_tags">
					<{foreach item=tag from=$album_images.tags name=tags}>
						<span class="image_tag" original-title="<{$tag.name}>">
							<{if $tag.icon}>
								<img width=16px height=16px src="<{$tag.icon}>" title="<{$tag.name}>" alt="<{$tag.name}>" />
							<{/if}>
							<a href="<{$tag.seoURL}>" title="<{$tag.name}>">
								<{$tag.name}>
							</a>
							<{if !$smarty.foreach.tags.last}>&nbsp;|&nbsp;<{/if}>
						</span>
						<{if $tag.dsc}>
							<span class="popup_tag"><{$tag.dsc}></span>
						<{/if}>
					<{/foreach}>
				</div>
			&nbsp;)
		<{/if}>
		
		<div class="img_desc" style="width: <{$album_images.display_width}>px" >
			<{$album_images.dsc}>
		</div>
		
		<{if $album_images.messages}>
			<div class="img_comments">
				<{foreach item=message from=$album_images.messages}>
					<{if $message.accessGranted}>
						<div class="img_comment <{if !$message.is_approved && $message.mycomment}>img_comment_waiting<{/if}> ">
							<div class="img_avatar">
								<img src="<{$message.avatar}>" width="32px" height="32px" alt="avatar" />
							</div>
							<div class="comment_info">
								<div class="message_ulink">
									<{$message.ulink}>&nbsp;<span class="message_date">(<{$message.date}>)</span>
								</div>
							</div>
							<div class="album_clear_left"></div>
							<div class="message_body">
								<p><{$message.body}></p>
								<{if !$message.is_approved && $message.mycomment}>
									<span class="message_waiting"><p><{$smarty.const._MD_IMG_WAITING_APPROVAL}></p> </span>
								<{/if}> 
							</div>
						</div>
					<{/if}>
				<{/foreach}>
			</div>
		<{/if}>
		<{if $icms_isuser && $use_image_comments}>
			<div class="img_comment_form">
				<{if $smarty.get.op == getByTags}>
					<form id="img_comment_form" action="<{$album_url}>submit.php?op=addmycomment&img_id=<{$album_images.id}>&tag=<{$tag_id}>" method="post">
				<{elseif $smarty.get.op == getByPublisher}>
					<form id="img_comment_form" action="<{$album_url}>submit.php?op=addcommentByPublisher&img_id=<{$album_images.id}>&uid=<{$album_images.img_publisher}>" method="post">
				<{else}>
					<form id="img_comment_form" action="<{$album_url}>submit.php?op=addcomment&img_id=<{$album_images.id}>&album_id=<{$album_images.a_id}>" method="post">
				<{/if}>
					<input type="hidden" name="name" value="<{$icms_userid}>" />
					<input type="hidden" name="item" value="<{$album_images.id}>" />
					
					<textarea name="img_comment" class="comment" cols="40" rows="4"></textarea>
					<input class="formButton" type="submit" value="<{$smarty.const._MD_ALBUM_SUBMIT}>" />
				</form>
				<{if $smarty.get.imglink}>
					<script type="text/javascript">
						$(document).ready(function(){
							// use colorbox for screenshots
							$('a#imglink-<{$smarty.get.imglink}>').each(function(){
								var $link = $(this);
								var maxH = $link.attr("maxheight");
								var maxW = $link.attr("maxwidth");
								var innerH = $link.attr("innerheight");
								var innerW = $link.attr("innerwidth");
								$link.colorbox({
									open: true,
									transition:'fade',
									speed:500,
									opacity: 0.9,
									photo: true,
									scalePhotos: true,
									slideshow: true,
									arrowKey: true,
									slideshowAuto: false,
									inline: true,
									maxWidth: maxW,
									maxHeight: maxH,
									innerWidth: innerW,
									innerHeight: innerH,
								});
							});
						});
					</script>
				<{/if}>
			</div>
		<{/if}>
	</div>
</div>